//
//  VC6FlappyBird.swift
//  ChapterAll
//
//  Created by Kevin on 2020/4/28.
//  Copyright © 2020 Kevin. All rights reserved.
//

import UIKit

class VC6FlappyBird: UIViewController {

    var bird:Bird?
    
    override func viewDidLoad() {
        super.viewDidLoad()

        //初始化像素鸟
        bird = Bird(frame: CGRect.zero)
        //设置位置
        bird?.center = CGPoint(x: 100, y: 300)
        self.view.addSubview(bird!)
        //开始飞行动画
        bird?.startFlaying()
    }
    
    override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
        bird?.upFlay()
        bird?.startLand()
    }
}
